
#pragma once

#include "GLmath.h"
#include "GLvec3.h"

class GLline
{
public:
	GLvec3f m_A,m_B;

	GLline(){}
	GLline( GLvec3f A,GLvec3f B ){ m_A = A;m_B = B; }

	float Length();
	GLvec3f DirectionAB();
	GLvec3f DirectionBA();

	void SetAB( GLvec3f A,GLvec3f B ){ m_A = A;m_B = B;}
	bool PtOnLine( const GLvec3f& pt,float epsilon  = ON_EPSILON ) const;
	bool PtInLine( const GLvec3f& pt,float epsilon  = ON_EPSILON ) const;
	bool PtProjectLine( const GLvec3f& pt ) const;
	bool GetClosestPoint( const GLvec3f& pt,GLvec3f& ptClosest);
	bool GetProjectPoint( const GLvec3f& pt,GLvec3f& ptCast);
};